import List
import Data.Maybe

xs = [ n * (n + 1) `div` 2 | n <- [1..] ]
isTriangle n = (n == (fromJust (find (>= n) xs)))

main = print (isTriangle 6)
